package com.admin.controller;


import com.common.domain.entity.Department;
import com.common.domain.entity.Goods;
import com.common.domain.entity.Point;
import com.common.domain.entity.ResponseResult;
import com.common.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("system/department")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @GetMapping("list")
    public ResponseResult allDepartmentList(Integer pageNum, Integer pageSize, String name){
        return departmentService.allDepartmentList(pageNum,pageSize,name);
    }


    @DeleteMapping("{ids}")
    public ResponseResult deleteDepartment(@PathVariable String ids){
        return departmentService.deleteDepartment(ids);
    }


    @PostMapping("/insertDepartment")
    public ResponseResult insertDepartment(@RequestBody Department department){
        return departmentService.insertDepartment(department);
    }
    @PutMapping
    public ResponseResult updateDepartment(@RequestBody Department department){
        return departmentService.updateDepartment(department);
    }
}
